package com.scau.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * Siaoja
 */
public class JsonUtil {

    public static String toJson(Object object)throws JsonProcessingException {
        String json;
        ObjectMapper objectMapper = new ObjectMapper();
        json = objectMapper.writeValueAsString(object);
        System.out.println(json);
        return json;
    }
}
